package com.demo.entity.Vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.demo.entity.Action;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@Data
public class RoleVo {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "角色ID")
    @TableId(value = "role_id",type = IdType.AUTO)
    private Integer roleId;

    @ApiModelProperty(value = "角色名称")
    @TableField("role_name")
    @NotBlank(message = "角色名称字段不能为空")
    @Max(value = 30,message = "最大长度不能超过-30")
    private String roleName;

    @ApiModelProperty(value = "角色权限集")
    @TableField("role_actions")
    private String roleActions;

    @ApiModelProperty(value = "角色权限集名称")
    private List<Action> roleActionsName;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    @NotNull(message = "创建人ID不能为空")
    @Max(value = 10,message = "最大长度不能超过-10")
    private Integer createdUserId;

    @ApiModelProperty(value = "删除时间")
    @TableField(value = "deleted_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deletedTime;

    @ApiModelProperty(value = "删除人ID")
    @TableField(value = "deleted_user_id")
    private Integer deletedUserId;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time",fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    @ApiModelProperty(value = "更新人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;

    private String createName;
    private String updateName;
}
